/*===========================================================================================================================
	Wolf Prop Protection
		By Goluch
			DO NOT UPLOAD TO GARRYSMOD.ORG
			
			
	Section: Derma Tick Bar
===========================================================================================================================*/
local Panel = {}

/*===========================================================================================================================
	Name: Panel.Init
	Purpose: Derma.
	Author: Goluch
===========================================================================================================================*/
function Panel:Init()
	self:SetSize(200,20);
	self.Ticks = { };
	for k,v in ipairs ( WPP.Actions ) do
		self.Ticks[k] = vgui.Create("WPPCheckBox",self);
		self.Ticks[k]:SetAction(k);
	end
	
	self:SetPlayer();
end

/*===========================================================================================================================
	Name: Panel.SetPlayer
	Purpose: Derma.
	Author: Goluch
===========================================================================================================================*/
function Panel:SetPlayer( Player )
	self.Player = Player;
	self.Name = "All Players";
	if ( Player ) then
		self.Name = Player:Name();
		for k,v in ipairs ( self.Ticks ) do
			v:SetPlayer( Player );
		end
		
	end
	
end

/*===========================================================================================================================
	Name: Panel.Think
	Purpose: Derma.
	Author: Goluch
===========================================================================================================================*/
function Panel:Think( )
	local x = self:GetWide() - (#self.Ticks * 20);
	for k,v in ipairs(self.Ticks) do
		v:SetPos(x+2,2);
		x = x + 20;
	end
	
end

/*===========================================================================================================================
	Name: Panel.Paint
	Purpose: Derma.
	Author: Goluch
===========================================================================================================================*/
function Panel:Paint( )
	draw.SimpleText(self.Name, "DefaultSmall", 2, self:GetTall() / 2, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER);
	//surface.SetDrawColor(255,255,255,255 );
	//surface.DrawLine(5,self:GetTall(),self:GetWide() - 5,self:GetTall());
end

derma.DefineControl( "WPPTickBar", "", Panel, "DPanel" );